let request = require('operation.js')

module.exports.getReceiptList = getReceiptList

function getReceiptList(noticeSid, classSid) {
    return new Promise((resolve, reject) => {
      request.getRequest('/receipts?noticeSid=' + noticeSid + '&klassSid=' + classSid,{}, true)
        .then(res => {
          var data = res.data;
          if (request.SUCCESSED == data.status) {
            resolve(data.items)
          } else {
            wx.showToast({
              title: data.msg,
              iocn: 'none'
            })
          }
        })
        .catch(e => {
          console.log(e)
        })
    })
}